﻿using System.Collections.Generic;
using ZilLion.Service.ZilLionOss.Domain.Entitys;

namespace ZilLion.Service.ZilLionOss.Domain.Services.Interface
{
    public interface IOssUserService
    {
        /// <summary>
        ///     初始化员工
        /// </summary>
        /// <param name="username"></param>
        /// <param name="zlcompanykey"></param>
        /// <returns></returns>
        OssUserInfoEntity InitUser(string username, string zlcompanykey);

        /// <summary>
        ///     修改员工信息
        /// </summary>
        /// <param name="entity"></param>
        void SaveUserInfo(OssUserInfoEntity entity);

        /// <summary>
        ///     修改密码
        /// </summary>
        /// <param name="entity"></param>
        void SaveUserpwd(OssUserPwdEntity entity);

        /// <summary>
        ///     根据员工ID 获取pwd
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        OssUserPwdEntity GetOssUserPwdByUserId(long userid);

        /// <summary>
        ///     员工制定岗位
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="roles"></param>
        void SerUserRoles(long userid, IList<long> roles);

        /// <summary>
        ///     岗位设置
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        OssRoleEntity SaveRole(OssRoleEntity entity);

        /// <summary>
        ///     岗位权限设置
        /// </summary>
        /// <param name="roleid"></param>
        /// <param name="routes"></param>
        void SetRoleRoutes(long roleid, IList<string> routes);

        /// <summary>
        ///     获取所有user信息
        /// </summary>
        /// <returns></returns>
        IList<OssUserInfoEntity> GetAllUsers();

        /// <summary>
        ///     获取用户信息
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        OssUserInfoEntity GetUserInfo(long userid);

        /// <summary>
        ///     获取用户信息
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        OssUserInfoEntity GetUserInfoByUsername(string username);

        /// <summary>
        ///     根据岗位获得路由信息
        /// </summary>
        /// <param name="roleid"></param>
        /// <returns></returns>
        IEnumerable<OssRoleRouteEntity> GetOssRoleRoutesByRoleid(long roleid);

        /// <summary>
        ///     根据用户获得路由信息
        /// </summary>
        /// <returns></returns>
        IEnumerable<OssUserRouteEntity> GetOssRoleRoutesByUserid(long userid);

        /// <summary>
        ///     获取用户的岗位
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        IEnumerable<OssRoleEntity> GetUserRoles(long userid);

        /// <summary>
        ///     删除用户
        /// </summary>
        /// <param name="userid"></param>
        void DeleteUser(long userid);
    }
}